package com.freeheart.aop.antireapte;


import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

/**
 * @author: EmperorHeart
 * @date: 2025/4/5 2:08
 * @description
 */
@AutoConfiguration
public class AntiRepeatSubmitAutoConfiguration {


    @Bean
    @ConditionalOnMissingBean
    public AntiRepeatLock antiRepeatLock() {
        return new SimpleAntiRepeatLock();
    }


    @Bean
    public AntiRepeatSubmitAspect antiRepeatSubmitAspect(AntiRepeatLock lock, ApplicationContext context) {
        return new AntiRepeatSubmitAspect(lock, context);
    }

}
